<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- <table id="table" border="1"></table> -->

    <!-- <input type="text" name="" id="e">
    <select id="sel">
        <option value="+">+</option>
        <option value="-">-</option>
        <option value="*">*</option>
        <option value="/">/</option>
        <option value="%">%</option>
    </select>
    <input type="text" name="" id="ee">
    <button id="btn">=</button>
    <span id="eee"></span> -->

    <!-- <input type="text" name="" id="row">
    <input type="text" name="" id="col">
    <button id="btn">确定</button>
    <table id="table" border="1"></table> -->
    <script>
        //将之前所有作业，全部封装成一个一个的函数
        //- 按需使用参数或返回值

        /* function a(){
            var male,female
            var num=56
            male=num*0.23
            female=num-male
            return female
        }
        console.log(a()) */

        /* function b(){
            var p=3.14
            var r=80
            var peri=r*2*p;
            var area=p*r**2;
            return  peri+'      '+area
        }
        console.log(b()) */
        
        /* function c(deg){
            var p=3.14
            var rad=deg/180*p
            console.log(rad)
        }
        c(180) */

        /* (function(hours){
            var dayh,h
            dayh=24
            h=hours%dayh
            var day
            day=(hours-h)/dayh
            var time=day+'天'+h+'小时'
            console.log(time)
        })(10010) */

        /* var a=function(){
            var num=56
            var rn=23
            var xnum=41
            var pro=rn/num
            var xpro=41*pro
            return xpro
        }
        console.log(a()) */
        
        /* var a=function(){
            var a=prompt()
            if(a>0){
                console.log('>0')
            }else if(a<0){
                console.log('<0')
            }else{
                console.log(0)
            }
        }() */

        /* var a=prompt();
        (function(a){
            if(a%2==0){
                console.log('偶数')
            }else{
                console.log('奇数')
            }
        })(a) */

        /* var a=prompt('身高')
        var b=prompt('体重')
        ;(function(a,b){
            if((a-108)*2==b-10){
                console.log('瘦')
            }else if((a-108)*2==b+10){
                console.log('胖')
            }else{
                console.log('匀称')
            }
        })(a,b); */


        /* var a=prompt('输入年份')
        var c=function(a){
            if(a%4==0&&a%100!=0||a%400==0){
                console.log('闰年')
            }else{
                console.log('平年')
            }
        }
        c(a) */

        /* var a=1
        var b=function(a){
            switch(a){
                case 0:
                    console.log('周日')
                    break
                case 1:
                    console.log('周1')
                    break
                case 2:
                    console.log('周2')
                    break
                case 3:
                    console.log('周3')
                    break
                case 4:
                    console.log('周4')
                    break
                case 5:
                    console.log('周5')
                    break
                case 6:
                    console.log('周6')
                    break
            }
        }
        b(a) */

        
        /* var a=prompt()
        var b=function(b){
            if(a<60){
                console.log('不及格')
            }else if(a>=60&&a<70){
                console.log('及格')
            }else if(a>=70&&a<80){
                console.log('良好')
            }else if(a>=80&&a<90){
                console.log('优秀')
            }else if(a>=90&&a<=100){
                console.log('xb')
            }
        }
        b(a) */

        /* function a(y,a,num){
            // var y = y
            // var a = a
            // var num = num
            switch (a) {
                case 12:
                    console.log(num = num + 31)
                case 11:
                    console.log(num = num + 30)
                case 10:
                    console.log(num = num + 31)
                case 9:
                    console.log(num = num + 30)
                case 8:
                    console.log(num = num + 31)
                case 7:
                    console.log(num = num + 31)
                case 6:
                    console.log(num = num + 30)
                case 5:
                    console.log(num = num + 31)
                case 4:
                    console.log(num = num + 30)
                case 3:
                    console.log(num = num + 31)
                case 2:
                    if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {
                        console.log('闰年')
                        console.log(num = num + 29)
                    } else {
                        console.log('平年')
                        console.log(num = num + 28)
                    }
                case 1:
                    console.log(num = num + 31)
            }
        }
        a(2000,12,0) */


        /* var r=prompt('请输入时薪')
        var $
        var h=prompt('请输入小时数')
        function a(r,h){
            if(h<=40){
            console.log($=h*r)
            }else if(h>40){
                console.log($=40*r+(h-40)*r*1.5)
            }
        }
        a(r,h) */

       /*  function c(a){
            for(var i=1;i<50;i++){
                b=a*0.05
                a+=b
            }
            console.log(a)
        }
        // var a=10000,b
        c(100000) */
        
        /* function a(){
            for(var i=1;i<=100;i++){
                if(!(i%7)){
                    console.log(i)
                }
            }
        }
        a() */

        
        /* function a(){
            var i=1,j=1,sum=0
            for(;j<=100;j++){
                if((j%2)){
                    sum+=i/j
                }else{
                    sum-=i/j
                }
            }
            return sum
        }
        console.log(a()) */

        /* var b=document.getElementById('table')
        var a=document.getElementById('table').innerHTML
        function c(){
            for(var i=1;i<=9;i++){
                a+='<tr>'
                for(var j=1;j<=i;j++){
                    a+='<td>'
                    a+=j+'×'+i+'='+j*i
                    a+='</td>'
                }
                a+='</tr>'
            }
            b.innerHTML+=a
        }
        c() */

        /* var a=function(){
            for(var i=100;i<=200;i++){
                if(i%3==0||i%7==0){
                    console.log(i)
                }
            }
        }
        a() */

        /* ;(function(){
            for(var i=4;i>=1;i--){
                for(var j=1;j<=i;j++){
                    document.write('&nbsp;')
                }
                for(var k=7;k>i;k--){
                    document.write('*')
                }
                document.write('<br>')
            }
            for(var i=1;i<4;i++){
                for(var j=5;j>1;j--){   
                    document.write('&nbsp;')
                }
                for(var k=4;k>1;k--){
                    document.write('*')
                }
                document.write('<br>')
            }
        })(); */

        /* ;(function(){
            var sum=0
            for(var i=0;i<64;i++){
                sum+=0.00001*(2**i)
            }
            console.log(sum+'kg')
        })(); */
        
        /* ;(function(){
            var e = document.getElementById('e')
            var ee = document.getElementById('ee')
            var eee = document.getElementById('eee')
            var btn = document.getElementById('btn')
            var select = document.getElementById('sel')
            var index = select.selectedIndex
            var selectedv = select.options[index].text
            btn.onclick = function () {
                index = select.selectedIndex
                selectedv = select.options[index].text
                switch (selectedv) {
                    case '+':
                        ev = Number(e.value)
                        eev = Number(ee.value)
                        eee.innerText = ev + eev
                        break
                    case '-':
                        ev = Number(e.value)
                        eev = Number(ee.value)
                        eee.innerText = ev - eev
                        break
                    case '*':
                        ev = Number(e.value)
                        eev = Number(ee.value)
                        eee.innerText = ev * eev
                        break
                    case '/':
                        ev = Number(e.value)
                        eev = Number(ee.value)
                        eee.innerText = ev / eev
                        break
                    case '%':
                        ev = Number(e.value)
                        eev = Number(ee.value)
                        eee.innerText = ev % eev
                }
            }
        })(); */

        /* ;(function(){
            let table = document.getElementById('table')
            var row = document.getElementById('row')
            var col = document.getElementById('col')
            var btn = document.getElementById('btn')
            btn.onclick = function () {
                var tableinner=''
                rowv = row.value
                colv = col.value
                for (var i = 0; i < rowv; i++) {
                    tableinner += '<tr>'
                    for (var j = 0; j < colv; j++) {
                        tableinner += '<td>' + (i + 1) + '-' + (j + 1) + '</td>'
                    }
                    tableinner += '</tr>'
                }
                console.log(tableinner)
                table.innerHTML = tableinner
            }
        })(); */

        
    </script>
</body>
</html>